package com.wicket.okrapp.web.contorller;

import com.github.pagehelper.Page;
import com.wicket.okrapp.biz.service.GridCalculateService;
import com.wicket.okrapp.biz.service.dto.req.*;
import com.wicket.okrapp.biz.service.dto.res.*;
import com.wicket.okrapp.common.ro.OkrResult;
import com.wicket.okrapp.common.util.CommonFunctionHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ：
 * @date ：
 *
 *
 * @version 1.0
 */
@RestController
@RequestMapping("/app/gridCalculate/")
public class GridCalculateController {

  @Autowired
  GridCalculateService gridCalculateService;
/**
   * D3-获取过程中期标准数据(公共)
   */
    @PostMapping("obtainMidProgressCycleStaDataCom")
    public OkrResult<ObtainMidProgressCycleStaDataComRespDto> obtainMidProgressCycleStaDataCom(@RequestBody @Validated ObtainMidProgressCycleStaDataComReqDto reqDTO){
    return OkrResult.success(gridCalculateService.obtainMidProgressCycleStaDataCom(reqDTO));
    }
///**
//   * D3-执行托底计算评价对象树(公共)
//   */
//    @PostMapping("implementUnderpinningCalcEvaObjectTreeCom")
//    public OkrResult<ImplementUnderpinningCalcEvaObjectTreeComRespDto> implementUnderpinningCalcEvaObjectTreeCom(@RequestBody @Validated ImplementUnderpinningCalcEvaObjectTreeComReqDto reqDTO){
//    return OkrResult.success(gridCalculateService.implementUnderpinningCalcEvaObjectTreeCom(reqDTO));
//    }
///**
//   * D3-执行托底计算OKR个人树(公共)
//   */
//    @PostMapping("implementUnderpinningCalcOkrSubjectPersonalCom")
//    public OkrResult<ImplementUnderpinningCalcOkrSubjectPersonalComRespDto> implementUnderpinningCalcOkrSubjectPersonalCom(@RequestBody @Validated ImplementUnderpinningCalcOkrSubjectPersonalComReqDto reqDTO){
//    return OkrResult.success(gridCalculateService.implementUnderpinningCalcOkrSubjectPersonalCom(reqDTO));
//    }
///**
//   * D3-执行托底计算OKR部门树(公共)
//   */
//    @PostMapping("implementUnderpinningCalcOkrSubjectDeptCom")
//    public OkrResult<ImplementUnderpinningCalcOkrSubjectDeptComRespDto> implementUnderpinningCalcOkrSubjectDeptCom(@RequestBody @Validated ImplementUnderpinningCalcOkrSubjectDeptComReqDto reqDTO){
//    return OkrResult.success(gridCalculateService.implementUnderpinningCalcOkrSubjectDeptCom(reqDTO));
//    }
///**
//   * D3-执行托底计算部门目标任务书树(公共)
//   */
//    @PostMapping("implementUnderpinningCalcFlevelObjTaskDutyDeptCom")
//    public OkrResult<ImplementUnderpinningCalcFlevelObjTaskDutyDeptComRespDto> implementUnderpinningCalcFlevelObjTaskDutyDeptCom(@RequestBody @Validated ImplementUnderpinningCalcFlevelObjTaskDutyDeptComReqDto reqDTO){
//    return OkrResult.success(gridCalculateService.implementUnderpinningCalcFlevelObjTaskDutyDeptCom(reqDTO));
//    }
/**
   * D3-分析目标周期是否满足托底计算(公共)
   */
    @PostMapping("implementTargetCycleCanExecuteUnderpinningCalcCom")
    public OkrResult<ImplementTargetCycleCanExecuteUnderpinningCalcComRespDto> implementTargetCycleCanExecuteUnderpinningCalcCom(@RequestBody @Validated ImplementTargetCycleCanExecuteUnderpinningCalcComReqDto reqDTO){
    return OkrResult.success(gridCalculateService.implementTargetCycleCanExecuteUnderpinningCalcCom(reqDTO));
    }
/**
   * D3-执行当前周期类型分析(公共)
   */
    @PostMapping("implementCurrentCycleTypeAnalysisCom")
    public OkrResult<ImplementCurrentCycleTypeAnalysisComRespDto> implementCurrentCycleTypeAnalysisCom(@RequestBody @Validated ImplementCurrentCycleTypeAnalysisComReqDto reqDTO){
    return OkrResult.success(null);
    }

/**
   * D3-执行自动汇报处理(公共)
   */
    @PostMapping("implementAutoReportCom")
    public OkrResult<ImplementAutoReportComRespDto> implementAutoReportCom(@RequestBody @Validated ImplementAutoReportComReqDto reqDTO){
    return OkrResult.success(gridCalculateService.implementAutoReportCom(reqDTO));
    }
/**
   * D3-执行回写是否自动汇报(公共)
   */
    @PostMapping("implementWriteBackTaskAutoReportCom")
    public OkrResult<ImplementWriteBackTaskAutoReportComRespDto> implementWriteBackTaskAutoReportCom(@RequestBody @Validated ImplementWriteBackTaskAutoReportComReqDto reqDTO){
    return OkrResult.success(gridCalculateService.implementWriteBackTaskAutoReportCom(reqDTO));
    }
/**
   * D3-执行当前周期类型分析(公共)
   */
    @PostMapping("implementCurrentCycleTypeAnalysisNoCalcCom")
    public OkrResult<ImplementCurrentCycleTypeAnalysisNoCalcComRespDto> implementCurrentCycleTypeAnalysisNoCalcCom(@RequestBody @Validated ImplementCurrentCycleTypeAnalysisNoCalcComReqDto reqDTO){
    return OkrResult.success(gridCalculateService.implementCurrentCycleTypeAnalysisNoCalcCom(reqDTO));
    }


/**
   * D3-执行重新计算标准数据(公共)
   */
    @PostMapping("implementRecalcStandardDataCom")
    public OkrResult<ImplementRecalcStandardDataComRespDto> implementRecalcStandardDataCom(@RequestBody @Validated ImplementRecalcStandardDataComReqDto reqDTO){
    return OkrResult.success(gridCalculateService.implementRecalcStandardDataCom(reqDTO));
    }

/**
   * D3-计算因子接收字段(公共)
   */
    @PostMapping("implementCalcReceivingFieldCom")
    public OkrResult<ImplementCalcReceivingFieldComRespDto> implementCalcReceivingFieldCom(@RequestBody @Validated ImplementCalcReceivingFieldComReqDto reqDTO){
    return OkrResult.success(gridCalculateService.implementCalcReceivingFieldCom(reqDTO));
    }


/**
   * D3-执行向右周期分析(公共)
   */
    @PostMapping("implementRightExecuteCycleStagCom")
    public OkrResult<ImplementRightExecuteCycleStagComRespDto> implementRightExecuteCycleStagCom(@RequestBody @Validated ImplementRightExecuteCycleStagComReqDto reqDTO){
    return OkrResult.success(null);
    }

/**
   * D3-执行重新计算标准数据(公共)
   */
    @PostMapping("implementRecalcAllStandardDataCom")
    public OkrResult<ImplementRecalcAllStandardDataComRespDto> implementRecalcAllStandardDataCom(@RequestBody @Validated ImplementRecalcAllStandardDataComReqDto reqDTO){
    return OkrResult.success(null);
    }



/**
   * D3-审核通过汇报任务相关(公共)
   */
    @PostMapping("approveSucceedReportTaskCom")
    public OkrResult<ApproveSucceedReportTaskComRespDto> approveSucceedReportTaskCom(@RequestBody @Validated ApproveSucceedReportTaskComReqDto reqDTO){
    return OkrResult.success(gridCalculateService.approveSucceedReportTaskCom(reqDTO));
    }
/**
   * D3-根据目标周期查询目标内容父中周期(公共)
   */
    @PostMapping("implementFatherAndMidTargetCycleIDCom")
    public OkrResult<ImplementFatherAndMidTargetCycleIDComRespDto> implementFatherAndMidTargetCycleIDCom(@RequestBody @Validated ImplementFatherAndMidTargetCycleIDComReqDto reqDTO){
    return OkrResult.success(gridCalculateService.implementFatherAndMidTargetCycleIDCom(reqDTO));
    }


/**
   * D3-目标过程周期的执行周期分析(公共)
   */
    @PostMapping("implementSubTargetCycleExecCycleAnalysisCom")
    public OkrResult<ImplementSubTargetCycleExecCycleAnalysisComRespDto> implementSubTargetCycleExecCycleAnalysisCom(@RequestBody @Validated ImplementSubTargetCycleExecCycleAnalysisComReqDto reqDTO){
    return OkrResult.success(null);
    }

/**
   * D3-执行父子中周期分析(公共)
   */
    @PostMapping("implementCom")
    public OkrResult<ImplementComRespDto> implementCom(@RequestBody @Validated ImplementComReqDto reqDTO){
    return OkrResult.success(gridCalculateService.implementCom(reqDTO));
    }


/**
   * D3-目标过程周期的执行周期分析（新）(公共)
   */
    @PostMapping("implementTargetCycleProExecCycleAnalysisNewCom")
    public OkrResult<ImplementTargetCycleProExecCycleAnalysisNewComRespDto> implementTargetCycleProExecCycleAnalysisNewCom(@RequestBody @Validated ImplementTargetCycleProExecCycleAnalysisNewComReqDto reqDTO){
    return OkrResult.success(gridCalculateService.implementTargetCycleProExecCycleAnalysisNewCom(reqDTO));
    }
/**
   * D3-执行计算进度参照值元素分析(公共)
   */
    @PostMapping("implementActualValueCalcReferenceAnalysisCom")
    public OkrResult<ImplementActualValueCalcReferenceAnalysisComRespDto> implementActualValueCalcReferenceAnalysisCom(@RequestBody @Validated ImplementActualValueCalcReferenceAnalysisComReqDto reqDTO){
    Page<?> page = CommonFunctionHelper.startPage(reqDTO.getPageNum(),reqDTO.getPageSize());

        ImplementActualValueCalcReferenceAnalysisComRespDto retData = gridCalculateService.implementActualValueCalcReferenceAnalysisCom(reqDTO);

        retData.setPageNum(page.getPageNum());
        retData.setPageSize(page.getPageSize());
        retData.setTotalNum(page.getTotal());
        return OkrResult.success(retData);

    }
/**
   * D3-执行计算目标参照值元素分析(公共)
   */
    @PostMapping("implementProgressValueCalcReferenceAnalysisCom")
    public OkrResult<ImplementProgressValueCalcReferenceAnalysisComRespDto> implementProgressValueCalcReferenceAnalysisCom(@RequestBody @Validated ImplementProgressValueCalcReferenceAnalysisComReqDto reqDTO){
    return OkrResult.success(gridCalculateService.implementProgressValueCalcReferenceAnalysisCom(reqDTO));
    }
/**
   * D3-执行周期阶段资料处理(公共)
   */
    @PostMapping("implementCycleStageDataCom")
    public OkrResult<ImplementCycleStageDataComRespDto> implementCycleStageDataCom(@RequestBody @Validated ImplementCycleStageDataComReqDto reqDTO){
    return OkrResult.success(gridCalculateService.implementCycleStageDataCom(reqDTO));
    }
/**
   * D3-分析最新可循环周期标准数据(公共)
   */
    @PostMapping("implementAnalysisCurrentCycleIsUpdateCycleCom")
    public OkrResult<ImplementAnalysisCurrentCycleIsUpdateCycleComRespDto> implementAnalysisCurrentCycleIsUpdateCycleCom(@RequestBody @Validated ImplementAnalysisCurrentCycleIsUpdateCycleComReqDto reqDTO){
    return OkrResult.success(gridCalculateService.implementAnalysisCurrentCycleIsUpdateCycleCom(reqDTO));
    }
/**
   * D3-根据是否自定义汇报分析目标内容ID(公共)
   */
    @PostMapping("implementGetTargetContentIdCom")
    public OkrResult<ImplementGetTargetContentIdComRespDto> implementGetTargetContentIdCom(@RequestBody @Validated ImplementGetTargetContentIdComReqDto reqDTO){
    return OkrResult.success(gridCalculateService.implementGetTargetContentIdCom(reqDTO));
    }

/**
   * D3-新增托底网格计算调度(公共)
   */
    @PostMapping("addUnderpinningCalcGridDispatchCom")
    public OkrResult<AddUnderpinningCalcGridDispatchComRespDto> addUnderpinningCalcGridDispatchCom(@RequestBody @Validated AddUnderpinningCalcGridDispatchComReqDto reqDTO){
    return OkrResult.success(gridCalculateService.addUnderpinningCalcGridDispatchCom(reqDTO));
    }
/**
   * D3-新增托底网格计算调度(公共)
   */
    @PostMapping("addUnderCalcGridDispatchCom")
    public OkrResult<AddUnderCalcGridDispatchComRespDto> addUnderCalcGridDispatchCom(@RequestBody @Validated AddUnderCalcGridDispatchComReqDto reqDTO){
    return OkrResult.success(gridCalculateService.addUnderCalcGridDispatchCom(reqDTO));
    }
/**
   * D3-执行获取目标内容子周期(公共)
   */
    @PostMapping("implementFindSubTargetCycleCom")
    public OkrResult<ImplementFindSubTargetCycleComRespDto> implementFindSubTargetCycleCom(@RequestBody @Validated ImplementFindSubTargetCycleComReqDto reqDTO){
    return OkrResult.success(gridCalculateService.implementFindSubTargetCycleCom(reqDTO));
    }

/**
   * D3-分析子周期是否等于末级周期(公共)
   */
    @PostMapping("implementAnalysisSubCycleIsLastCycleCom")
    public OkrResult<ImplementAnalysisSubCycleIsLastCycleComRespDto> implementAnalysisSubCycleIsLastCycleCom(@RequestBody @Validated ImplementAnalysisSubCycleIsLastCycleComReqDto reqDTO){
    return OkrResult.success(gridCalculateService.implementAnalysisSubCycleIsLastCycleCom(reqDTO));
    }
/**
   * D3-定时计算全网内容标准数据(公共)
   */
    @PostMapping("timingCalcAllDataCom")
    public OkrResult<TimingCalcAllDataComRespDto> timingCalcAllDataCom(@RequestBody @Validated TimingCalcAllDataComReqDto reqDTO){
    return OkrResult.success(gridCalculateService.timingCalcAllDataCom(reqDTO));
    }
/**
   * 1111D3-发布批次重计算全模板标准数据(公共)
   */
    @PostMapping("implementReleaseRecalcEvaTempAllDataCom")
    public OkrResult<ImplementReleaseRecalcEvaTempAllDataComRespDto> implementReleaseRecalcEvaTempAllDataCom(@RequestBody @Validated ImplementReleaseRecalcEvaTempAllDataComReqDto reqDTO){
    return OkrResult.success(gridCalculateService.implementReleaseRecalcEvaTempAllDataCom(reqDTO));
    }
/**
   * D3分析汇报任务筛选父子中周期类型(公共)
   */
    @PostMapping("implementFatherMidSubCycleAnalysisCom")
    public OkrResult<ImplementFatherMidSubCycleAnalysisComRespDto> implementFatherMidSubCycleAnalysisCom(@RequestBody @Validated ImplementFatherMidSubCycleAnalysisComReqDto reqDTO){
    return OkrResult.success(gridCalculateService.implementFatherMidSubCycleAnalysisCom(reqDTO));
    }

}
